package com.polaris.live.widget.avatar

import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.RelativeLayout

/**
 * AvatarRelativeLayout头像包裹类  使头像重新改变大小  和AvatarFrameView  AvatarView配合使用
 * @author Created by 天晴 on 2024/4/12 19:58
 * @since 1.0.0
 **/
class AvatarRelativeLayout(context: Context?, attrs: AttributeSet?) :
    RelativeLayout(context, attrs) {


    override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
        super.onLayout(changed, l, t, r, b)
        for (i in 0 until childCount) {
            val child: View = getChildAt(i)
            child.layout(
                0,
                0,
                width,
                height
            )
        }

    }

}